import api from '@/plugins/axiosInstance'

//获取动态标签
export async function getDynamicTagList() {
	let resp = await api.get("/api/dynamics/tags")
	return resp.data.data;
}

//获取动态
export async function getDynamicList() {
	let resp = await api.get('/api/dynamics');
	return resp.data.data.list;
}



//点赞事件
export async function likeClick(dynamicId) {
	let resp = await api.get(`/api/dynamics/${dynamicId}/like`);
}

//上传说说
export async function shareDynamic(content,album,tagList,isAnonymous) {
	let resp = await api.post("/api/dynamics/share",{ content,album,tagList,isAnonymous})
	return resp.data.code === 200;
}

// 上传照片返回url
export async function upload(formData) {
	let resp = await api.post('/api/upload/dynamic',formData,{
        'Content-Type' : 'multipart/form-data'
 	})
	return resp.data.data;
}